package ServiceContainer

import "errors"

//. 这里存放了所有worker类的实例
var Instances map[string]interface{} = make(map[string]interface{})

//. 绑定实例
func Bind(name string, service interface{}) {
	Instances[name] = service
}
//. 获取实例
func Making(name string) (service interface{}, err error) {
	if _, ok := Instances[name]; !ok {
		err = errors.New("nil")
		return
	}
	service = Instances[name]
	return
}